package com.aaa.inside.mapper;

import com.aaa.entity.inside.Inventory;
import com.aaa.entity.inside.InventoryLocator;
import com.aaa.entity.inside.InventoryLocatorDetail;
import com.aaa.vo.R;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author aaa
 * @since 2020-11-30
 */
public interface InventoryMapper extends BaseMapper<Inventory> {
    @Select("select * from s_inventory_locator_detail d join s_inventory_locator lo on d.pid=lo.id\n" +
            "join s_inventory y on y.inventoryno=lo.inventoryno\n" +
            "where y.inventoryno=#{inventoryno}")
    List<InventoryLocatorDetail> selectDetailByInvNo(String inventoryno);
    @Select("select  y.*,group_concat(l.locatorcode) loccodes from s_inventory y join s_inventory_locator l on y.inventoryno=l.inventoryno where y.warehouseid=#{warehouseid} group by y.id")
    List<Inventory> selectInv(Long warehouseid);
    @Select("select * from s_inventory_locator l join s_inventory y on l.inventoryno=y.inventoryno\n" +
            "where l.inventoryno=#{inventoryno}")
    List<InventoryLocator> selectLoByInvNo(String inventoryno);
}
